/*************************************************************************
 *                     COPYRIGHT NOTICE
 *            Copyright 2024 Horizon Robotics, Inc.
 *                   All rights reserved.
 *************************************************************************/
#pragma once
#include <cstdint>
#include <iostream>
#include <cstdarg>

#define GPU_SAMPLE_LOG_NO_LOG  0
#define GPU_SAMPLE_LOG_ERROR   1
#define GPU_SAMPLE_LOG_WARNING 2
#define GPU_SAMPLE_LOG_INFO    3

void gpu_sample_log_message(int32_t level, const char *file, int32_t line, const char *format, ...)
#ifdef __GNUC__
   __attribute__((format(printf, 4, 5)))
#endif
   ;

#define GPU_SAMPLE_LOG(level, ...)                                              \
	do                                                                      \
	{                                                                     	\
		gpu_sample_log_message(level, __FILE__, __LINE__, __VA_ARGS__);	\
	} while (0)

#define SAMPLE_LOG_ERROR(...) GPU_SAMPLE_LOG(GPU_SAMPLE_LOG_ERROR, __VA_ARGS__)
#define SAMPLE_LOG_WARNING(...) GPU_SAMPLE_LOG(GPU_SAMPLE_LOG_WARNING, __VA_ARGS__)
#define SAMPLE_LOG_INFO(...) GPU_SAMPLE_LOG(GPU_SAMPLE_LOG_INFO, __VA_ARGS__)